<template>
	<view class="my_bos">
		<view class="my_title bg-cover">
			<view class="my_title_name">
				<image :src="doctorobj.img" mode=""></image>
				<view class="font15 font-ffffff">{{doctorobj.name}}</view>
			</view>
			<!-- 切换 -->
			<view class="switch_box" @click.stop="Ondoctor">
				<image src="../../static/com/switch_a.png"></image>
				<text class="font-ffffff font14">切换账号</text>
			</view>
		</view>
		<!-- 信息 -->
		<view class="information">
			<view v-for="(item,index) in informationList" :key="index" @click="Onjumpa(item)">
				<view class="information_list" v-if="item.show">
					<image class="info_image" :src="item.img"></image>
					<view class="info_box">
						<view>{{item.title}}</view>
						<text>{{item.text}}</text>
					</view>
					<image class="info_morea" src="../../static/my/morea.png"></image>
				</view>
			</view>
		</view>
		<ComTabBarDoc :selected="2"></ComTabBarDoc>
		<!-- 退出登录 -->
		<view class="signout">
			<view class="signout_box" @click="Onlogout">退出登录</view>
		</view>
	</view>
</template>

<script>
	import ComTabBarDoc from '@/components/ComTabBarDoc.vue';
	export default {
		components: {
			ComTabBarDoc
		},
		data() {
			return {
				doctorobj: {}, //详情
				//信息
				informationList: [{
						title: '个人资料修改',
						img: require('@/static/my/info_a.png'),
						text: '',
						url: '/pagesA/doctor/material',
						show: true,
					},
					{
						title: '服务设置',
						img: require('@/static/ification_c.png'),
						url: '/pagesA/doctor/setup',
						text: '',
						show: true,
					}, {
						title: '患者评价',
						img: require('@/static/my/stars.png'),
						text: '',
						url: '/pagesA/doctor/evaluate',
						show: true,
					}
				]
			}
		},
		onShow: function() {
			wx.hideTabBar()
			//详情
			this.Ondoctorinfo()
		},
		methods: {
			//详情
			Ondoctorinfo() {
				this.$Http({
					url: 'getUserInfo',
					data: {},
					type:'POST',
				}).then(res => {
					if (res.code == 1) {
						res.data.doctor_info.img = this.$store.state.http_img + res.data.doctor_info.img
						this.doctorobj = res.data.doctor_info
					}
				});
			},
			//跳转页面
			Onjumpa(res) {
				let url = res.url
				uni.navigateTo({
					url: url,
				})
			},
			//前往患者端
			Ondoctor() {
				// uni.switchTab({
				// 	url: '/pages/my/index',
				// })
				uni.navigateTo({
					url: '/pages/my/change',
				})
			},
			//退出登录
			Onlogout() {
				this.$store.dispatch('logout')
				uni.clearStorage();
				uni.switchTab({
					url: '/pages/home/index',
				})
			},
		}
	}
</script>

<style>
	page{
		padding-bottom: constant(safe-area-inset-bottom);
		padding-bottom: env(safe-area-inset-bottom);
	}
	/* 头部 */
	.my_title {
		height: 360rpx;
		width: 750rpx;
		background-color: #2db7f5;
		display: flex;
		align-items: center;
		justify-content: center;
		position: relative;
	}

	.my_title_name {
		width: 750rpx;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	.my_title_name image {
		height: 120rpx;
		width: 120rpx;
		border-radius: 60rpx;
		margin-bottom: 26rpx;
	}

	.my_title_name text {
		margin-left: 10rpx;
	}

	.switch_box {
		position: absolute;
		display: flex;
		align-items: center;
		right: 25rpx;
		top: 160rpx;
		/* 		background-color: #ffffff;
		border-radius: 30rpx; */
		padding: 10rpx 10rpx;
	}

	.switch_box image {
		width: 36rpx;
		height: 36rpx;
		margin-right: 10rpx;
	}

	/* 信息 */
	.information_list {
		height: 110rpx;
		width: 750rpx;
		padding: 0 40rpx;
		display: flex;
		align-items: center;
		border-bottom: 2rpx #f5f5f5 solid;
	}

	.information_list:last-child {
		/* border-bottom: 0rpx #f5f5f5 solid; */
	}

	.info_image {
		height: 42rpx;
		width: 42rpx;
	}

	.info_morea {
		width: 13rpx;
		height: 24rpx;
	}

	.info_box {
		width: 612rpx;
		display: flex;
		justify-content: space-between;
		padding: 0 20rpx 0 30rpx;
	}

	.info_box view {
		font-size: 30rpx;
		color: #323232;
	}

	/* 退出登录 */
	.signout {
		height: 184rpx;
		width: 750rpx;
		display: flex;
		align-items: center;
		justify-content: center;
		position: fixed;
		bottom: 160rpx;
		left: 0;
	}

	.signout_box {
		width: 655rpx;
		height: 85rpx;
		background-color: #f5f5f5;
		border-radius: 10rpx;
		font-size: 32rpx;
		color: #323232;
		line-height: 85rpx;
		text-align: center;
	}

	.my_border {
		width: 750rpx;
		height: 15rpx;
		background-color: #f9f9f9;
	}
</style>
